import axios from "@/common/axios";
import { API_URL } from "@/common/constants";

export const querySafeRuleList = async (json) => {
  let { data } = await axios.post(API_URL + "rSafeRuleApi/querySafeRuleList", json);
  return data;
};

export const updateSafeRule = async (json) => {
  let { data } = await axios.post(API_URL + "rSafeRuleApi/updateSafeRule", json);
  return data;
};
export const updateAudit = async (json) => {
  let { data } = await axios.post(API_URL + "rSafeRuleApi/updateAudit", json);
  return data;
};


export const addSafeRule = async (json) => {
  let { data } = await axios.post(API_URL + "rSafeRuleApi/addSafeRule", json);
  return data;
};



export const delSafeRule = async (json) => {
  let { data } = await axios.post(API_URL + "rSafeRuleApi/delSafeRule", json);
  return data;
};


export const importExcel = async (formData) => {
  let { data } = await axios.post(API_URL + "rSafeRuleApi/importExcel", formData, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8'
    }
  });
  return data;

}


export const uploadFile = async (formData) => {
  let { data } = await axios.post(API_URL + "rSafeRuleApi/uploadFile", formData, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8'
    }
  });
  return data;

}